package com.yuelao.rabbitmq.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author FLY
 * @version v1.0
 * @project yuelao-server
 * @date 2017/9/15 14:30
 * @修改记录 版本       修改人         修改时间         修改内容描述
 * --------------------------------------------------
 * <p>
 * --------------------------------------------------
 */
@Slf4j
@Component
public class MqConsumer {

    @RabbitHandler
    @RabbitListener(queues = "simpleQueue")
    public void simpleQueue(String msg) {
        log.info("simpleQueue%%%%%%%%%%%{}", msg);
    }

    @RabbitHandler
    @RabbitListener(queues = "topic.message")
    public void topicMessage(String msg) {
        log.info("topic.message%%%%%%%%%%%{}", msg);
    }

    @RabbitHandler
    @RabbitListener(queues = "topic.messages")
    public void topicMessages(String msg) {
        log.info("topic.messages%%%%%%%%%%%{}消费成功", msg);
    }

    @RabbitHandler
    @RabbitListener(queues = "topicA")
    public void topicA(String msg) {
        log.info("topicA%%%%%%%%%%%{}", msg);
    }

    @RabbitHandler
    @RabbitListener(queues = "topicB")
    public void topicB(String msg) {
        log.info("topicB%%%%%%%%%%%{}", msg);
    }

    @RabbitHandler
    @RabbitListener(queues = "topicC")
    public void topicC(String msg) {
        log.info("topicC%%%%%%%%%%%{}", msg);
    }
}
